trigger UpdateChurnStatus  on Account (after update) {
ID CxGIOGAccountRecordtypID = RecordTypeHelper.GetRecordTypeIdByDevName('Account', 'CSS_Customer'); 
if(RecursiveCheck.firstRun1){
    Set<Id> ids= New Set<Id>();
        for(Account acct:Trigger.New)
        {
         if(acct.RecordTypeId==CxGIOGAccountRecordtypID && acct.Churn_Status__c!=''){
         ids.add(acct.id);
         }
        }
        ID CxGcampaignmemberrecordtypeID = RecordTypeHelper.GetRecordTypeIdByDevName('CXG_Campaign_Accounts__c', 'Campaign_Member');       
    if(ids.Size()>0)
    {
    List<Account> acct = [Select Id,RecordTypeId,Churn_Status__c,Month_Year__c from Account where Id in : ids ];
    List<CXG_Campaign_Accounts__c> cmlist =[Select Id,Customer__r.Churn_Status__c,Customer__r.Month_Year__c,Customer__r.RecordTypeId,Customer__c from CXG_Campaign_Accounts__c where Customer__c IN :ids AND IscampaignActive__c=true AND RecordTypeId=:CxGcampaignmemberrecordtypeID];
        for(CXG_Campaign_Accounts__c cm:cmlist)
        {
          if(cm.Customer__r.RecordTypeId==CxGIOGAccountRecordtypID && cm.Customer__r.Churn_Status__c!='')
          {
          cm.Churnstatus__c =cm.Customer__r.Churn_Status__c ;
          cm.Month_Year__c=cm.Customer__r.Month_Year__c;
          }
        }
    RecursiveCheck.firstRun1=false;
    try{
    update cmlist;
    }
    catch(Exception exe){
    System.Debug('EXCEPTION'+exe);
    }
    }
}
}